class ArticleStatusesController < ApplicationController
  before_filter :authenticate
  
  # GET /article_statuses
  # GET /article_statuses.xml
  def index
    @article_statuses = ArticleStatus.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @article_statuses }
    end
  end

  # GET /article_statuses/1
  # GET /article_statuses/1.xml
  def show
    @article_status = ArticleStatus.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @article_status }
    end
  end

  # GET /article_statuses/new
  # GET /article_statuses/new.xml
  def new
    @article_status = ArticleStatus.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @article_status }
    end
  end

  # GET /article_statuses/1/edit
  def edit
    @article_status = ArticleStatus.find(params[:id])
  end

  # POST /article_statuses
  # POST /article_statuses.xml
  def create
    @article_status = ArticleStatus.new(params[:article_status])

    respond_to do |format|
      if @article_status.save
        format.html { redirect_to(@article_status, :notice => 'Article status was successfully created.') }
        format.xml  { render :xml => @article_status, :status => :created, :location => @article_status }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @article_status.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /article_statuses/1
  # PUT /article_statuses/1.xml
  def update
    @article_status = ArticleStatus.find(params[:id])

    respond_to do |format|
      if @article_status.update_attributes(params[:article_status])
        format.html { redirect_to(@article_status, :notice => 'Article status was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @article_status.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /article_statuses/1
  # DELETE /article_statuses/1.xml
  def destroy
    @article_status = ArticleStatus.find(params[:id])
    @article_status.destroy

    respond_to do |format|
      format.html { redirect_to(article_statuses_url) }
      format.xml  { head :ok }
    end
  end
end
